<template>
  <div class="footer">
    <div class="footer-main flex-box">
      <div class="left" @click="$router.push('/')" :class="{active:routeName === 'home'}">
        <span>
          <svg class="icon" aria-hidden="true"><use xlink:href="#icon-wenzheng-shouyeSVG"></use></svg></span>
        <P>首页</P>
      </div>
      <div class="center flex-box" @click="$router.push('/zhuanjia')">
        <p><span>
          <svg class="icon" aria-hidden="true"><use xlink:href="#icon-wenzheng-tiwenSVG"></use></svg>
        </span>
        <i>提问</i>
        </p>
      </div>
      <div class="right" @click="$router.push('/mine')" :class="{active:routeName === 'mine'}">
        <span>
          <svg class="icon" aria-hidden="true"><use xlink:href="#icon-wenzheng-wodeSVG"></use></svg></span>
        <P>我的</P>
      </div>
    </div>
  </div>
</template>
<script>
// @ is an alias to /src

export default {
  data() {
    return {
      list: '',
      routeName: 'home'
    }
  },
  name: 'needs',
  computed: {},
  created() {
    this.routeName = this.$route.name
  },
  watch: {
    $route(to) {
      this.routeName = to.name
    }
  },
  methods: {},
  mounted() {}
}
</script>
<style lang="scss" scoped>
.footer {
  position: fixed;
  width: 100%;
  bottom: 0;
  left: 0;
  height: 50px;
  text-align: center;
  z-index: 666666;
  border-top: 1px solid #eee;
  background: #fff;
  .footer-main {
    max-width: 500px;
    height: 100%;
    margin: 0 auto;
    justify-content: space-around;
    -webkit-justify-content: space-around;
    .left,
    .right {
      color: #ccc;
      font-size: 26px;
      a {
        font-size: 26px;
        color: #ccc;
      }
      p {
        font-size: 11px;
        margin-top: 2px;
      }
    }
    .active {
      color: #6dbbfe;
      a {
        color: #6dbbfe;
      }
    }
    .center {
      width: 88px;
      height: 40px;
      color: #fff;
      font-size: 18px;
      border-radius: 100px;
      background: #6dbbfe;
      span {
        font-size: 24px;
        float: left;
        line-height: 40px;
        margin-right: 4px;
        margin-top: 2px;
      }
      i {
        float: left;
        line-height: 40px;
        margin-top: 2px;
      }
    }
  }
}
</style>
